import type { FC } from "react";

interface Props {
  name?: string;
  age?: number;
}

const defaultProps = { name: "张三", age: 18 };

const HelloWorld: FC<Props> = ({ name = "张三", age = 18 }) => {
  console.log("HelloWorld props", name, age);

  return (
    <div>
      <p>Hello World - {name}</p>

      <button
        onClick={() => {
          name = "里斯";
        }}
      >
        点我,修改 name
      </button>
    </div>
  );
};

export default HelloWorld;
